package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SelectOption;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SchoolClassMapper;
import com.ruoyi.system.domain.SchoolClass;
import com.ruoyi.system.service.ISchoolClassService;

/**
 * 班级信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-29
 */
@Service
public class SchoolClassServiceImpl implements ISchoolClassService 
{
    @Autowired
    private SchoolClassMapper schoolClassMapper;

    /**
     * 查询班级信息
     * 
     * @param id 班级信息主键
     * @return 班级信息
     */
    @Override
    public SchoolClass selectSchoolClassById(Long id)
    {
        return schoolClassMapper.selectSchoolClassById(id);
    }

    /**
     * 查询班级信息列表
     * 
     * @param schoolClass 班级信息
     * @return 班级信息
     */
    @Override
    public List<SchoolClass> selectSchoolClassList(SchoolClass schoolClass)
    {
        return schoolClassMapper.selectSchoolClassList(schoolClass);
    }

    /**
     * 新增班级信息
     * 
     * @param schoolClass 班级信息
     * @return 结果
     */
    @Override
    public int insertSchoolClass(SchoolClass schoolClass)
    {
        schoolClass.setCreateTime(DateUtils.getNowDate());
        return schoolClassMapper.insertSchoolClass(schoolClass);
    }

    /**
     * 修改班级信息
     * 
     * @param schoolClass 班级信息
     * @return 结果
     */
    @Override
    public int updateSchoolClass(SchoolClass schoolClass)
    {
        return schoolClassMapper.updateSchoolClass(schoolClass);
    }

    /**
     * 批量删除班级信息
     * 
     * @param ids 需要删除的班级信息主键
     * @return 结果
     */
    @Override
    public int deleteSchoolClassByIds(Long[] ids)
    {
        return schoolClassMapper.deleteSchoolClassByIds(ids);
    }

    /**
     * 删除班级信息信息
     * 
     * @param id 班级信息主键
     * @return 结果
     */
    @Override
    public int deleteSchoolClassById(Long id)
    {
        return schoolClassMapper.deleteSchoolClassById(id);
    }

    @Override
    public List<SelectOption> getSelectOptionList(){
//        List<SelectOption> options = schoolClassMapper.selectSelectOptionList();
//        return options;
        return schoolClassMapper.selectSelectOptionList();
    }
}
